package com.tong.embeddedvr.service;

import com.tong.embeddedvr.dto.*;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * TODO
 *
 * @author gcl
 * @version 1.0
 * @Description
 * @date 2020/12/27 13:54
 */
public interface HomeworkService {

    /**
     * @Description 根据collectionId显示homework表项
     * @Author gcl
     * @Date 2021/1/1 18:42
     * @param: tableReqDTO
     * @param: collectionDTO
     * @Return java.util.List<com.tong.embeddedvr.dto.HomeworkDTO>
     */
    TableRspDTO showTable(TableReqDTO tableReqDTO, CollectionDTO collectionDTO) throws Exception;

    /**
     * @Description 根据userId显示所有的homework,注意这里显然显示的是学生提交的作业
     * @Author gcl
     * @Date 2020/12/27 13:59
     * @param:
     * @Return java.util.List<com.tong.embeddedvr.dto.HomeworkDTO>
     * @return
     */
    TableRspDTO showTable(TableReqDTO tableReqDTO, UserInputDTO userInputDTO) throws Exception;

    /**
     * @Description 根据homeworkId显示对应的homework
     * @Author gcl
     * @Date 2020/12/27 14:00
     * @param: homeworkDTO
     * @Return com.tong.embeddedvr.dto.HomeworkDTO
     */
    HomeworkDTO showHomework(HomeworkDTO homeworkDTO) throws Exception;


    /**
     * @Description 根据homeworkId更新homeworkEvaluate
     * @Author gcl
     * @Date 2020/12/27 14:01
     * @param: homeworkDTO
     * @Return java.lang.Integer
     */
    Integer evaluate(HomeworkDTO homeworkDTO) throws Exception;

    /**
     * @Description 提交作业,初次需要更新creatTime,之后每次更细createTime
     * @Author gcl
     * @Date 2021/1/2 18:32
     * @param: homeworkDTO
     * @Return java.lang.Integer
     */
    Integer submitHomework(HomeworkDTO homeworkDTO,CollectionDTO collectionDTO) throws Exception;
    
    /**
     * @Description 更新作业的内容,需要更新submitTime
     * @Author gcl
     * @Date 2020/12/27 14:02
     * @param: homeworkDTO
     * @Return java.lang.Integer
     */
    Integer updatedHomework(HomeworkDTO homeworkDTO) throws Exception;

    /**
     * @Description 文件上传
     * @Author gcl
     * @Date 2021/2/26 10:59
     * @param: request
     * @param: file
     * @Return java.lang.String
     */
    String fileUpload(HttpServletRequest request, CommonsMultipartFile file);

    /**
     * @Description 文件下载
     * @Author gcl
     * @Date 2021/2/26 11:00
     * @param: httpServletResponse
     * @Return java.lang.String
     */
    void fileDownload(HttpServletResponse resp,HomeworkDTO homeworkDTO);

    /**
     * @Description 根据用户名和作业集id查找作业,用于HomeworkEdit页面的初始化
     * @Author gcl
     * @Date 2021/2/26 13:42
     * @param: homeworkDTO
     * @Return String
     */
    String showHomeworkByUserIdAndCollectionId(HomeworkDTO homeworkDTO);

    /**
     * @Description 删除作业
     * @Author gcl
     * @Date 2021/3/15 18:13
     * @param: homeworkDTO
     * @Return java.lang.String
     */
    String delHomework(HomeworkDTO homeworkDTO);
}
